<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Emma的单词复习卡</title>
    <style>
        body {
            font-family: 'Georgia', serif;
            background: linear-gradient(135deg, #f0f4f8, #d9e4f0);
            color: #2c3e50;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            margin: 0;
            overflow: hidden;
        }

        h1 {
            font-size: 2.5rem;
            color: #34495e;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
            margin-bottom: 40px;
        }

        .card-container {
            perspective: 1000px;
            width: 400px;
            height: 250px;
            position: relative;
            margin-bottom: 50px;
        }

        .card {
            width: 100%;
            height: 100%;
            position: absolute;
            transform-style: preserve-3d;
            transition: transform 0.6s;
            cursor: pointer;
        }

        .card.flipped {
            transform: rotateY(180deg);
        }

        .card-face {
            width: 100%;
            height: 100%;
            position: absolute;
            backface-visibility: hidden;
            border-radius: 15px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
            background: white;
        }

        .card-front {
            background: linear-gradient(135deg, #6a85b6, #bac8e0);
            color: white;
        }

        .card-back {
            background: linear-gradient(135deg, #a6c0fe, #f68084);
            transform: rotateY(180deg);
            color: white;
        }

        .word-number {
            font-size: 1rem;
            margin-bottom: 10px;
            color: #ffffff;
            font-weight: bold;
        }

        .word {
            font-size: 2.5rem;
            font-weight: bold;
            margin-bottom: 10px;
        }

        .pronunciation {
            font-size: 1.2rem;
            font-style: italic;
            margin-bottom: 10px;
        }

        .translation, .example, .related {
            font-size: 1rem;
            margin-bottom: 10px;
            text-align: center;
        }

        .example {
            font-style: italic;
        }

        button {
            padding: 12px 24px;
            font-size: 1.2rem;
            background: linear-gradient(135deg, #6a85b6, #bac8e0);
            color: white;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            transition: background 0.3s;
        }

        button:hover {
            background: linear-gradient(135deg, #bac8e0, #6a85b6);
        }
    </style>
    <script>
        const words = [
            {
                number: 31,
                word: "Foothill",
                pronunciation: "/ˈfuːthɪl/",
                translation: "山麓；山脚",
                example: "Another fire was burning in the foothills above Pasadena, northeast of Los Angeles.",
                related: "Hill（小山）"
            },
            {
                number: 32,
                word: "Smoky",
                pronunciation: "/ˈsməʊki/",
                translation: "有烟的；烟雾弥漫的",
                example: "The sky above the Pacific Coast Highway turned orange and thickened with smoke.",
                related: "Smoke（烟雾）"
            },
            {
                number: 33,
                word: "Inferno",
                pronunciation: "/ɪnˈfɜːrnoʊ/",
                translation: "火灾；地狱之火",
                example: "Extreme winds sparked several firestorms across Los Angeles.",
                related: "Firestorm（火灾风暴）"
            },
            {
                number: 34,
                word: "Firestorm",
                pronunciation: "/ˈfaɪərstɔːrm/",
                translation: "火灾风暴；大火",
                example: "Extreme winds sparked several firestorms across Los Angeles.",
                related: "Inferno（地狱之火）"
            },
            {
                number: 35,
                word: "Drought",
                pronunciation: "/draʊt/",
                translation: "干旱；旱灾",
                example: "Nine months without measurable rainfall had primed the city to burn.",
                related: "Dry（干燥的）"
            }
        ];

        let currentIndex = 0;

        function flipCard() {
            const card = document.querySelector('.card');
            card.classList.toggle('flipped');
        }

        function loadCard(index) {
            const currentWord = words[index];
            document.querySelector('.word-number').textContent = `单词编号: ${currentWord.number}`;
            document.querySelector('.word').textContent = currentWord.word;
            document.querySelector('.pronunciation').textContent = currentWord.pronunciation;
            document.querySelector('.translation').textContent = `释义: ${currentWord.translation}`;
            document.querySelector('.example').textContent = `例句: ${currentWord.example}`;
            document.querySelector('.related').textContent = `相关词汇: ${currentWord.related}`;
            speakWord(currentWord.word);
        }

        function speakWord(word) {
            const utterance = new SpeechSynthesisUtterance(word);
            utterance.lang = 'en-US';
            window.speechSynthesis.speak(utterance);
        }

        function nextCard() {
            currentIndex = (currentIndex + 1) % words.length;
            loadCard(currentIndex);
            const card = document.querySelector('.card');
            if (card.classList.contains('flipped')) {
                card.classList.remove('flipped');
            }
        }

        window.onload = () => {
            loadCard(currentIndex);
            document.querySelector('.card-container').addEventListener('click', flipCard);
            document.querySelector('button').addEventListener('click', nextCard);
        };
    </script>
</head>
<body>
    <h1>Emma喊你来复习单词啦</h1>
    <div class="card-container">
        <div class="card">
            <div class="card-face card-front">
                <div class="word-number"></div>
                <div class="word"></div>
                <div class="pronunciation"></div>
            </div>
            <div class="card-face card-back">
                <div class="translation"></div>
                <div class="example"></div>
                <div class="related"></div>
            </div>
        </div>
    </div>
    <button>NEXT</button>
</body>
</html>
